#include "Command.h"
#include "Scene.h"

namespace FinalRendering
{
	namespace Editor
	{
		class CopyObjectCommand : public Command
		{
		public:
			Array<Selection> selection;
		public:
			void PerformAction(Scene * scene);
			void UndoAction(Scene * scene);
		};

		class PasteObjectCommand : public Command
		{
		private:
			bool performed;
		public:
			Array<RefPtr<Brush>> brushes;
			Array<RefPtr<Entity>> entities;
		public:
			PasteObjectCommand();
			void PerformAction(Scene * scene);
			void UndoAction(Scene * scene);
		};

		class DeleteObjectCommand : public Command
		{
		public:
			Array<int> brushID;
			Array<int> entityID;
			Array<RefPtr<Brush>> brushes;
			Array<RefPtr<Entity>> entities;
			bool update;
		public:
			DeleteObjectCommand();
			void PerformAction(Scene * scene);
			void UndoAction(Scene * scene);
		};

		class AddBrushCommand : public Command
		{
		public:
			RefPtr<Brush> brush;
			void PerformAction(Scene * scene);
			void UndoAction(Scene * scene);
		};

		class GroupCommand : public Command
		{
		public:
			Array<Selection> selection;
			Array<int> oriGroupID;
			RefPtr<Group> group;
		public:
			void PerformAction(Scene * scene);
			void UndoAction(Scene * scene);
		};

		class UngroupCommand : public Command
		{
		public:
			struct Modification
			{
				Selection sel;
				int oriGroupID;
			};
			struct DeletedGroup
			{
				RefPtr<Group> group;
				Array<int> childGroups;
			};
			Array<Selection> Selection;
			Array<RefPtr<DeletedGroup>> removedGroups;
			Array<Modification> modifications;
		public:
			void PerformAction(Scene * Scene);
			void UndoAction(Scene * Scene);
		};
	}
}